from dotenv import load_dotenv
import os
import sys

import numpy as np
import math
import matplotlib.pyplot as plt
import matplotlib.colors as mcolors
from scipy import stats, special
from scipy.optimize import minimize_scalar
from collections.abc import Callable
from scipy.optimize import minimize
from scipy.optimize import least_squares
from scipy.integrate import quad
from scipy import special as sc
from matplotlib.typing import ColorType
from abc import ABC, abstractmethod
import colorsys
import pandas as pd
import copy
import random
import time
import os
import sys
import json
import re
from typing import NewType,TypeVar, Union, Iterable, Tuple, List, Dict, Any, Iterable, Type, Optional, Callable, Generator, Hashable, Sized, SupportsFloat, SupportsIndex, SupportsAbs, SupportsRound, SupportsComplex, SupportsInt, SupportsBytes, SupportsComplex, SupportsFloat, SupportsInt, SupportsRound, SupportsAbs, SupportsBytes, SupportsComplex, SupportsFloat, SupportsIndex, SupportsInt, SupportsRound, SupportsAbs, SupportsBytes, SupportsComplex, SupportsFloat, SupportsIndex, SupportsInt, SupportsRound, SupportsAbs, SupportsBytes, SupportsComplex, SupportsFloat, SupportsIndex, SupportsInt, SupportsRound, SupportsAbs, SupportsBytes, SupportsComplex, SupportsFloat, SupportsIndex, SupportsInt, SupportsRound, SupportsAbs, SupportsBytes, SupportsComplex, SupportsFloat, SupportsIndex, SupportsInt, SupportsRound, SupportsAbs, SupportsBytes, SupportsComplex, SupportsFloat, SupportsIndex, SupportsInt, SupportsRound, SupportsAbs, SupportsBytes, SupportsComplex, SupportsFloat, SupportsIndex, SupportsInt, SupportsRound, SupportsAbs, SupportsBytes, SupportsComplex
from collections.abc import Mapping, Sequence

type FloatOrArray = np.ndarray|float|np.floating

MinFloat = 1e-5
# 解决中文乱码问题
plt.rcParams['font.sans-serif'] = ['SimHei'] # 设置字体为黑体
plt.rcParams['axes.unicode_minus'] = False # 解决负号显示为方块的问题

def load_dot_env():
	# 加载.env文件中的变量
	load_dotenv()

	# 使用环境变量
	python_path = os.getenv('PYTHONPATH')
	for p in python_path.split(':'):
		dir_path = os.path.join(os.getcwd(),p)
		print(dir_path)
		sys.path.append(dir_path)